package post2;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author User
 */



public class PostTerminal extends javax.swing.JFrame {

    /**
     * Creates new form PostTerminal
     */
    
    Post post;
    BigDecimal total;
    Date date;
    
    public PostTerminal(Post post) {
        initComponents();
        this.post = post;
        total = new BigDecimal("0.00");
        date = new Date();
        
        //set post terminal date
        dateLabel.setText(date.toString());
        
        // get array of upc from product catalog and set combobox model
        upcComboBox.setModel(new javax.swing.DefaultComboBoxModel(post.getAllUPC()));
        upcComboBox.setSelectedIndex(-1);
        enterButton.setEnabled(false);
        payButton.setEnabled(false);
        
        //initialize transaction
        post.newTransaction();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        productPanel = new javax.swing.JPanel();
        upcLabel = new javax.swing.JLabel();
        upcComboBox = new javax.swing.JComboBox();
        quantityLabel = new javax.swing.JLabel();
        quantityComboBox = new javax.swing.JComboBox();
        enterButton = new javax.swing.JButton();
        customerLabel = new javax.swing.JLabel();
        nameTextField = new javax.swing.JTextField();
        invoicePanel = new javax.swing.JPanel();
        itemLabel = new javax.swing.JLabel();
        qtyLabel = new javax.swing.JLabel();
        unitPriceLabel = new javax.swing.JLabel();
        extendedLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        invoiceTextArea = new javax.swing.JTextArea();
        totalLabel = new javax.swing.JLabel();
        totalAmountLabel = new javax.swing.JLabel();
        paymentPanel = new javax.swing.JPanel();
        paymentTypeLabel = new javax.swing.JLabel();
        payTypeComboBox = new javax.swing.JComboBox();
        amountLabel = new javax.swing.JLabel();
        amountTextField = new javax.swing.JTextField();
        payButton = new javax.swing.JButton();
        dateLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("POST Terminal");

        productPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Product", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Courier New", 0, 12))); // NOI18N

        upcLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        upcLabel.setText("UPC");

        upcComboBox.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        upcComboBox.setMaximumRowCount(9);
        upcComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                upcComboBoxActionPerformed(evt);
            }
        });

        quantityLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        quantityLabel.setText("Quantity");

        quantityComboBox.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        quantityComboBox.setMaximumRowCount(9);
        quantityComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9" }));

        enterButton.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        enterButton.setText("Enter");
        enterButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enterButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout productPanelLayout = new javax.swing.GroupLayout(productPanel);
        productPanel.setLayout(productPanelLayout);
        productPanelLayout.setHorizontalGroup(
            productPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(productPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(upcLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(upcComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(quantityLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(quantityComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, productPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(enterButton)
                .addGap(61, 61, 61))
        );
        productPanelLayout.setVerticalGroup(
            productPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(productPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(productPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(upcLabel)
                    .addComponent(upcComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(quantityLabel)
                    .addComponent(quantityComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(enterButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        customerLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        customerLabel.setText("Customer Name");

        nameTextField.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        nameTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nameTextFieldActionPerformed(evt);
            }
        });

        invoicePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Invoice", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Courier New", 0, 12))); // NOI18N

        itemLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        itemLabel.setText("ITEM");

        qtyLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        qtyLabel.setText("QTY");

        unitPriceLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        unitPriceLabel.setText("UNIT_PRICE");

        extendedLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        extendedLabel.setText("EXTENDED_PRICE");

        invoiceTextArea.setEditable(false);
        invoiceTextArea.setColumns(20);
        invoiceTextArea.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        invoiceTextArea.setRows(5);
        jScrollPane1.setViewportView(invoiceTextArea);

        totalLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        totalLabel.setText("TOTAL");

        totalAmountLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        totalAmountLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        totalAmountLabel.setText("$0.00");

        javax.swing.GroupLayout invoicePanelLayout = new javax.swing.GroupLayout(invoicePanel);
        invoicePanel.setLayout(invoicePanelLayout);
        invoicePanelLayout.setHorizontalGroup(
            invoicePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(invoicePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(invoicePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(invoicePanelLayout.createSequentialGroup()
                        .addComponent(jScrollPane1)
                        .addContainerGap())
                    .addGroup(invoicePanelLayout.createSequentialGroup()
                        .addComponent(itemLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 278, Short.MAX_VALUE)
                        .addComponent(qtyLabel)
                        .addGap(62, 62, 62)
                        .addComponent(unitPriceLabel)
                        .addGap(59, 59, 59)
                        .addComponent(extendedLabel)
                        .addGap(24, 24, 24))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, invoicePanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(totalLabel)
                .addGap(18, 18, 18)
                .addComponent(totalAmountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26))
        );
        invoicePanelLayout.setVerticalGroup(
            invoicePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(invoicePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(invoicePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(itemLabel)
                    .addComponent(qtyLabel)
                    .addComponent(unitPriceLabel)
                    .addComponent(extendedLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(invoicePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(totalLabel)
                    .addComponent(totalAmountLabel))
                .addContainerGap())
        );

        paymentPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Payment", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Courier New", 0, 12))); // NOI18N

        paymentTypeLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        paymentTypeLabel.setText("Payment Type");

        payTypeComboBox.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        payTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cash", "Credit", "Check" }));
        payTypeComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                payTypeComboBoxActionPerformed(evt);
            }
        });

        amountLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        amountLabel.setText("Amount");

        amountTextField.setEditable(false);
        amountTextField.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        amountTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

        payButton.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        payButton.setText("Pay");
        payButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                payButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout paymentPanelLayout = new javax.swing.GroupLayout(paymentPanel);
        paymentPanel.setLayout(paymentPanelLayout);
        paymentPanelLayout.setHorizontalGroup(
            paymentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(paymentPanelLayout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(paymentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(payButton)
                    .addGroup(paymentPanelLayout.createSequentialGroup()
                        .addComponent(paymentTypeLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(payTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(amountLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(amountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        paymentPanelLayout.setVerticalGroup(
            paymentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(paymentPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(paymentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(paymentTypeLabel)
                    .addComponent(payTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(amountLabel)
                    .addComponent(amountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(payButton)
                .addGap(7, 7, 7))
        );

        dateLabel.setFont(new java.awt.Font("Courier New", 0, 13)); // NOI18N
        dateLabel.setText("Sat Jun 29 17:33:48 GEST 2002");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(invoicePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(customerLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(productPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addComponent(dateLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                        .addComponent(paymentPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(37, 37, 37)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerLabel)
                            .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(productPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(invoicePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(paymentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(dateLabel)
                        .addContainerGap(81, Short.MAX_VALUE))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void enterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterButtonActionPerformed
        // TODO add your handling code here:
        BigDecimal qty = new BigDecimal(String.valueOf(quantityComboBox.getSelectedItem()));
        String upc = String.valueOf(upcComboBox.getSelectedItem());
        
        BigDecimal extendedPrice = qty.multiply(post.getPrice(upc));
        total = total.add(extendedPrice);
        invoiceTextArea.append(String.format("%-27s %13s %17s %20s\n", post.getDescription(upc), qty, post.getPrice(upc), extendedPrice));
        totalAmountLabel.setText("$" + total);
        amountTextField.setText(total.toString());
        post.newTransactionItem(upc, qty);
        payButton.setEnabled(true);
    }//GEN-LAST:event_enterButtonActionPerformed

    private void nameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nameTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_nameTextFieldActionPerformed

    private void payTypeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_payTypeComboBoxActionPerformed
        // TODO add your handling code here:
        String paymentType = (payTypeComboBox.getSelectedItem()).toString();
        BigDecimal amtTendered;
        if (paymentType.equals("Cash")){
            amountTextField.setEditable(false);
            amountLabel.setText("Amount");
            amountTextField.setText(total.toString());
            amtTendered = new BigDecimal(amountTextField.getText());
            post.newPayment("Cash", total.doubleValue());
        } else if (paymentType.equals("Check")){
            amountTextField.setEditable(false);
            amountLabel.setText("Amount");
            amountTextField.setText(total.toString());
            post.newPayment("Check", total.doubleValue());
        } else if (paymentType.equals("Credit")) {
            amountLabel.setText("Number");
            amountTextField.setText("00000");
            amountTextField.setEditable(true);
            post.newPayment("Credit", total.doubleValue());
        }
    }//GEN-LAST:event_payTypeComboBoxActionPerformed

    private void payButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_payButtonActionPerformed
        // TODO add your handling code here:
        
        post.newTransactionHeader(new Date(), nameTextField.getText());   
        dateLabel.setText(new Date().toString());
        nameTextField.setText("");
        amountTextField.setText("");
        invoiceTextArea.setText("");    
        totalAmountLabel.setText("$0.00");
        total = new BigDecimal("0.00");
        upcComboBox.setSelectedIndex(-1);
        quantityComboBox.setSelectedIndex(0);
        payTypeComboBox.setSelectedIndex(0);
        enterButton.setEnabled(false);
        payButton.setEnabled(false);

        //start new transaction
        post.newTransaction();
    }//GEN-LAST:event_payButtonActionPerformed

    private void upcComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_upcComboBoxActionPerformed
        // TODO add your handling code here:
        enterButton.setEnabled(true);
    }//GEN-LAST:event_upcComboBoxActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PostTerminal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PostTerminal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PostTerminal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PostTerminal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PostTerminal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel amountLabel;
    private javax.swing.JTextField amountTextField;
    private javax.swing.JLabel customerLabel;
    private javax.swing.JLabel dateLabel;
    private javax.swing.JButton enterButton;
    private javax.swing.JLabel extendedLabel;
    private javax.swing.JPanel invoicePanel;
    private javax.swing.JTextArea invoiceTextArea;
    private javax.swing.JLabel itemLabel;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField nameTextField;
    private javax.swing.JButton payButton;
    private javax.swing.JComboBox payTypeComboBox;
    private javax.swing.JPanel paymentPanel;
    private javax.swing.JLabel paymentTypeLabel;
    private javax.swing.JPanel productPanel;
    private javax.swing.JLabel qtyLabel;
    private javax.swing.JComboBox quantityComboBox;
    private javax.swing.JLabel quantityLabel;
    private javax.swing.JLabel totalAmountLabel;
    private javax.swing.JLabel totalLabel;
    private javax.swing.JLabel unitPriceLabel;
    private javax.swing.JComboBox upcComboBox;
    private javax.swing.JLabel upcLabel;
    // End of variables declaration//GEN-END:variables
}
